﻿using SharpML.Api.Abstraction;
using SharpML.Api.Enumerations;
using SharpML.Api.Interfaces;
using System;
using System.Collections.Generic;

namespace SharpML.Api.Types
{
    /// <summary>
    /// Just a strongly-typed dictionary of lists of <see cref="PluginComponent"/>s keyed by <see cref="PluginComponentType"/>
    /// </summary>
    public class PluginComponents : Dictionary<PluginComponentType, IList<IPluginComponent>>
    {
        public PluginComponents()
        {
            // Prime dictionary for all known entries
            // This is done generically so I can add extend component types 
            foreach( var componentType in Enum.GetNames( typeof( PluginComponentType ) ) )
                Add( (PluginComponentType)Enum.Parse( typeof( PluginComponentType ), componentType ), new List<IPluginComponent>() );
        }
    }
}
